/*     */ package com.zimbra.cs.mailbox.calendar;
/*     */ 
/*     */ import com.zimbra.common.calendar.ZCalendar.ICalTok;
/*     */ import com.zimbra.common.service.ServiceException;
/*     */ import com.zimbra.cs.mailbox.MailServiceException;
/*     */ import java.util.HashMap;
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ public class IcalXmlStrMap
/*     */ {
/*     */   IcalXmlStrMap(String name)
/*     */   {
/*  33 */     this.mMapName = name;
/*     */   }
/*     */   
/*     */   public void add(String ical, String xml) {
/*  37 */     this.fwdMap.put(ical.toUpperCase(), xml);
/*  38 */     this.bakMap.put(xml.toUpperCase(), ical);
/*     */   }
/*     */   
/*     */ 
/*  42 */   public String toXml(String name) { return (String)this.fwdMap.get(name.toUpperCase()); }
/*     */   
/*     */   public String toIcal(String name) throws ServiceException {
/*  45 */     String toRet = (String)this.bakMap.get(name.toUpperCase());
/*  46 */     if (toRet == null) {
/*  47 */       throw MailServiceException.INVALID_REQUEST("Unknown string '" + name + "' for parameter " + this.mMapName, null);
/*     */     }
/*  49 */     return toRet;
/*     */   }
/*     */   
/*     */   public boolean validXml(String str) {
/*  53 */     return this.bakMap.containsKey(str.toUpperCase());
/*     */   }
/*     */   
/*     */   public boolean validICal(String str) {
/*  57 */     return this.fwdMap.containsKey(str.toUpperCase());
/*     */   }
/*     */   
/*  60 */   public static IcalXmlStrMap sFreqMap = new IcalXmlStrMap("Freq");
/*  61 */   public static IcalXmlStrMap sClassMap = new IcalXmlStrMap("Class");
/*  62 */   public static IcalXmlStrMap sTranspMap = new IcalXmlStrMap("Transparency");
/*  63 */   public static IcalXmlStrMap sFreeBusyMap = new IcalXmlStrMap("FreeBusy");
/*  64 */   public static IcalXmlStrMap sOutlookFreeBusyMap = new IcalXmlStrMap("OutlookFreeBusy");
/*  65 */   public static IcalXmlStrMap sStatusMap = new IcalXmlStrMap("Status");
/*  66 */   public static IcalXmlStrMap sPartStatMap = new IcalXmlStrMap("PartStat");
/*  67 */   public static IcalXmlStrMap sRoleMap = new IcalXmlStrMap("Role");
/*  68 */   public static IcalXmlStrMap sCUTypeMap = new IcalXmlStrMap("CUType");
/*     */   
/*  70 */   private HashMap<String, String> fwdMap = new HashMap();
/*  71 */   private HashMap<String, String> bakMap = new HashMap();
/*     */   
/*     */   private String mMapName;
/*     */   
/*     */   public static final String FREQ_YEARLY = "YEA";
/*     */   
/*     */   public static final String FREQ_WEEKLY = "WEE";
/*     */   
/*     */   public static final String FREQ_SECONDLY = "SEC";
/*     */   
/*     */   public static final String FREQ_MONTHLY = "MON";
/*     */   
/*     */   public static final String FREQ_MINUTELY = "MIN";
/*     */   
/*     */   public static final String FREQ_HOURLY = "HOU";
/*     */   
/*     */   public static final String FREQ_DAILY = "DAI";
/*     */   
/*     */   public static final String CLASS_PUBLIC = "PUB";
/*     */   
/*     */   public static final String CLASS_PRIVATE = "PRI";
/*     */   
/*     */   public static final String CLASS_CONFIDENTIAL = "CON";
/*     */   
/*     */   public static final String FBTYPE_BUSY = "B";
/*     */   
/*     */   public static final String FBTYPE_FREE = "F";
/*     */   
/*     */   public static final String FBTYPE_BUSY_TENTATIVE = "T";
/*     */   
/*     */   public static final String FBTYPE_BUSY_UNAVAILABLE = "O";
/*     */   
/*     */   public static final String FBTYPE_NODATA = "N";
/*     */   
/*     */   public static final String TRANSP_OPAQUE = "O";
/*     */   
/*     */   public static final String TRANSP_TRANSPARENT = "T";
/*     */   
/*     */   public static final String STATUS_TENTATIVE = "TENT";
/*     */   
/*     */   public static final String STATUS_CONFIRMED = "CONF";
/*     */   
/*     */   public static final String STATUS_CANCELLED = "CANC";
/*     */   public static final String STATUS_NEEDS_ACTION = "NEED";
/*     */   public static final String STATUS_COMPLETED = "COMP";
/*     */   public static final String STATUS_IN_PROCESS = "INPR";
/*     */   public static final String STATUS_ZCO_WAITING = "WAITING";
/*     */   public static final String STATUS_ZCO_DEFERRED = "DEFERRED";
/*     */   public static final String PARTSTAT_TENTATIVE = "TE";
/*     */   public static final String PARTSTAT_NEEDS_ACTION = "NE";
/*     */   public static final String PARTSTAT_DELEGATED = "DG";
/*     */   public static final String PARTSTAT_DECLINED = "DE";
/*     */   public static final String PARTSTAT_COMPLETED = "CO";
/*     */   public static final String PARTSTAT_ACCEPTED = "AC";
/*     */   public static final String PARTSTAT_IN_PROCESS = "IN";
/*     */   public static final String PARTSTAT_ZCO_WAITING = "WA";
/*     */   public static final String PARTSTAT_ZCO_DEFERRED = "DF";
/*     */   public static final String ROLE_NON_PARTICIPANT = "NON";
/*     */   public static final String ROLE_OPT_PARTICIPANT = "OPT";
/*     */   public static final String ROLE_REQUIRED = "REQ";
/*     */   public static final String ROLE_CHAIR = "CHA";
/*     */   public static final String CUTYPE_INDIVIDUAL = "IND";
/*     */   public static final String CUTYPE_GROUP = "GRO";
/*     */   public static final String CUTYPE_RESOURCE = "RES";
/*     */   public static final String CUTYPE_ROOM = "ROO";
/*     */   public static final String CUTYPE_UNKNOWN = "UNK";
/*     */   
/*     */   static
/*     */   {
/* 140 */     sCUTypeMap.add(ZCalendar.ICalTok.INDIVIDUAL.toString(), "IND");
/* 141 */     sCUTypeMap.add(ZCalendar.ICalTok.GROUP.toString(), "GRO");
/* 142 */     sCUTypeMap.add(ZCalendar.ICalTok.RESOURCE.toString(), "RES");
/* 143 */     sCUTypeMap.add(ZCalendar.ICalTok.ROOM.toString(), "ROO");
/* 144 */     sCUTypeMap.add(ZCalendar.ICalTok.UNKNOWN.toString(), "UNK");
/*     */     
/* 146 */     sRoleMap.add(ZCalendar.ICalTok.CHAIR.toString(), "CHA");
/* 147 */     sRoleMap.add(ZCalendar.ICalTok.REQ_PARTICIPANT.toString(), "REQ");
/* 148 */     sRoleMap.add(ZCalendar.ICalTok.OPT_PARTICIPANT.toString(), "OPT");
/* 149 */     sRoleMap.add(ZCalendar.ICalTok.NON_PARTICIPANT.toString(), "NON");
/*     */     
/* 151 */     sStatusMap.add(ZCalendar.ICalTok.TENTATIVE.toString(), "TENT");
/* 152 */     sStatusMap.add(ZCalendar.ICalTok.CONFIRMED.toString(), "CONF");
/* 153 */     sStatusMap.add(ZCalendar.ICalTok.CANCELLED.toString(), "CANC");
/* 154 */     sStatusMap.add(ZCalendar.ICalTok.NEEDS_ACTION.toString(), "NEED");
/* 155 */     sStatusMap.add(ZCalendar.ICalTok.COMPLETED.toString(), "COMP");
/* 156 */     sStatusMap.add(ZCalendar.ICalTok.IN_PROCESS.toString(), "INPR");
/* 157 */     sStatusMap.add(ZCalendar.ICalTok.X_ZIMBRA_STATUS_WAITING.toString(), "WAITING");
/* 158 */     sStatusMap.add(ZCalendar.ICalTok.X_ZIMBRA_STATUS_DEFERRED.toString(), "DEFERRED");
/*     */     
/* 160 */     sPartStatMap.add(ZCalendar.ICalTok.ACCEPTED.toString(), "AC");
/* 161 */     sPartStatMap.add(ZCalendar.ICalTok.COMPLETED.toString(), "CO");
/* 162 */     sPartStatMap.add(ZCalendar.ICalTok.DECLINED.toString(), "DE");
/* 163 */     sPartStatMap.add(ZCalendar.ICalTok.DELEGATED.toString(), "DG");
/* 164 */     sPartStatMap.add(ZCalendar.ICalTok.IN_PROCESS.toString(), "IN");
/* 165 */     sPartStatMap.add(ZCalendar.ICalTok.NEEDS_ACTION.toString(), "NE");
/* 166 */     sPartStatMap.add(ZCalendar.ICalTok.TENTATIVE.toString(), "TE");
/* 167 */     sPartStatMap.add(ZCalendar.ICalTok.X_ZIMBRA_PARTSTAT_WAITING.toString(), "WA");
/* 168 */     sPartStatMap.add(ZCalendar.ICalTok.X_ZIMBRA_PARTSTAT_DEFERRED.toString(), "DF");
/*     */     
/* 170 */     sClassMap.add(ZCalendar.ICalTok.PUBLIC.toString(), "PUB");
/* 171 */     sClassMap.add(ZCalendar.ICalTok.PRIVATE.toString(), "PRI");
/* 172 */     sClassMap.add(ZCalendar.ICalTok.CONFIDENTIAL.toString(), "CON");
/*     */     
/* 174 */     sFreeBusyMap.add("FREE", "F");
/* 175 */     sFreeBusyMap.add("BUSY", "B");
/* 176 */     sFreeBusyMap.add("BUSY-TENTATIVE", "T");
/* 177 */     sFreeBusyMap.add("BUSY-UNAVAILABLE", "O");
/* 178 */     sFreeBusyMap.add("X-ZIMBRA-FREEBUSY-NODATA", "N");
/*     */     
/* 180 */     sOutlookFreeBusyMap.add("FREE", "F");
/* 181 */     sOutlookFreeBusyMap.add("BUSY", "B");
/* 182 */     sOutlookFreeBusyMap.add("TENTATIVE", "T");
/* 183 */     sOutlookFreeBusyMap.add("OOF", "O");
/*     */     
/* 185 */     sTranspMap.add(ZCalendar.ICalTok.TRANSPARENT.toString(), "T");
/* 186 */     sTranspMap.add(ZCalendar.ICalTok.OPAQUE.toString(), "O");
/*     */     
/* 188 */     sFreqMap.add(ZRecur.Frequency.DAILY.toString(), "DAI");
/* 189 */     sFreqMap.add(ZRecur.Frequency.HOURLY.toString(), "HOU");
/* 190 */     sFreqMap.add(ZRecur.Frequency.MINUTELY.toString(), "MIN");
/* 191 */     sFreqMap.add(ZRecur.Frequency.MONTHLY.toString(), "MON");
/* 192 */     sFreqMap.add(ZRecur.Frequency.SECONDLY.toString(), "SEC");
/* 193 */     sFreqMap.add(ZRecur.Frequency.WEEKLY.toString(), "WEE");
/* 194 */     sFreqMap.add(ZRecur.Frequency.YEARLY.toString(), "YEA");
/*     */   }
/*     */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/mailbox/calendar/IcalXmlStrMap.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */